package com.qfedu.sem.repository;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import com.qfedu.sem.po.Bug;

public interface BugRepository extends JpaRepository<Bug, String>{

	Page<Bug> findAllByTitleLike(String string, Pageable pageInput);

	List<Bug> findAllByOrderByCommitTimeDesc();

	@Query ("select bug.version.no, count(bug.id) from Bug bug where bug.project.id = ?1 and bug.currentNode = ?2 group by bug.version.no")
	List<Object[]> findAllByProjectAndNode(String projectId, String currentNode);

	void deleteByIdIn(String[] id);

}
